Integrand size = 30, antiderivative size = 331 \[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=-\frac {B \sqrt {a+b x+c x^2}}{f}-\frac {(b B+2 A c) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {c} f}-\frac {\left (B \sqrt {d}-A \sqrt {f}\right ) \sqrt {c d-b \sqrt {d} \sqrt {f}+a f} \text {arctanh}\left (\frac {b \sqrt {d}-2 a \sqrt {f}+\left (2 c \sqrt {d}-b \sqrt {f}\right ) x}{2 \sqrt {c d-b \sqrt {d} \sqrt {f}+a f} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {d} f^{3/2}}+\frac {\left (B \sqrt {d}+A \sqrt {f}\right ) \sqrt {c d+b \sqrt {d} \sqrt {f}+a f} \text {arctanh}\left (\frac {b \sqrt {d}+2 a \sqrt {f}+\left (2 c \sqrt {d}+b \sqrt {f}\right ) x}{2 \sqrt {c d+b \sqrt {d} \sqrt {f}+a f} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {d} f^{3/2}} \]
[Out]
Time = 0.39 (sec) , antiderivative size = 331, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1035, 1092, 635, 212, 1047, 738} \[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=-\frac {\left (B \sqrt {d}-A \sqrt {f}\right ) \sqrt {a f+b \left (-\sqrt {d}\right ) \sqrt {f}+c d} \text {arctanh}\left (\frac {-2 a \sqrt {f}+x \left (2 c \sqrt {d}-b \sqrt {f}\right )+b \sqrt {d}}{2 \sqrt {a+b x+c x^2} \sqrt {a f+b \left (-\sqrt {d}\right ) \sqrt {f}+c d}}\right )}{2 \sqrt {d} f^{3/2}}+\frac {\left (A \sqrt {f}+B \sqrt {d}\right ) \sqrt {a f+b \sqrt {d} \sqrt {f}+c d} \text {arctanh}\left (\frac {2 a \sqrt {f}+x \left (b \sqrt {f}+2 c \sqrt {d}\right )+b \sqrt {d}}{2 \sqrt {a+b x+c x^2} \sqrt {a f+b \sqrt {d} \sqrt {f}+c d}}\right )}{2 \sqrt {d} f^{3/2}}-\frac {(2 A c+b B) \text {arctanh}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {c} f}-\frac {B \sqrt {a+b x+c x^2}}{f} \]
[In]
[Out]
Rule 212
Rule 635
Rule 738
Rule 1035
Rule 1047
Rule 1092
Rubi steps \begin{align*} \text {integral}& = -\frac {B \sqrt {a+b x+c x^2}}{f}+\frac {\int \frac {\frac {1}{2} (b B d+2 a A f)+(B c d+A b f+a B f) x+\frac {1}{2} (b B+2 A c) f x^2}{\sqrt {a+b x+c x^2} \left (d-f x^2\right )} \, dx}{f} \\ & = -\frac {B \sqrt {a+b x+c x^2}}{f}-\frac {\int \frac {-\frac {1}{2} (b B+2 A c) d f-\frac {1}{2} f (b B d+2 a A f)-f (B c d+A b f+a B f) x}{\sqrt {a+b x+c x^2} \left (d-f x^2\right )} \, dx}{f^2}-\frac {(b B+2 A c) \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{2 f} \\ & = -\frac {B \sqrt {a+b x+c x^2}}{f}-\frac {(b B+2 A c) \text {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{f}+\frac {\left (\left (B \sqrt {d}-A \sqrt {f}\right ) \left (c d-b \sqrt {d} \sqrt {f}+a f\right )\right ) \int \frac {1}{\left (-\sqrt {d} \sqrt {f}-f x\right ) \sqrt {a+b x+c x^2}} \, dx}{2 \sqrt {d} f}+\frac {\left (\left (B \sqrt {d}+A \sqrt {f}\right ) \left (c d+b \sqrt {d} \sqrt {f}+a f\right )\right ) \int \frac {1}{\left (\sqrt {d} \sqrt {f}-f x\right ) \sqrt {a+b x+c x^2}} \, dx}{2 \sqrt {d} f} \\ & = -\frac {B \sqrt {a+b x+c x^2}}{f}-\frac {(b B+2 A c) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {c} f}-\frac {\left (\left (B \sqrt {d}-A \sqrt {f}\right ) \left (c d-b \sqrt {d} \sqrt {f}+a f\right )\right ) \text {Subst}\left (\int \frac {1}{4 c d f-4 b \sqrt {d} f^{3/2}+4 a f^2-x^2} \, dx,x,\frac {b \sqrt {d} \sqrt {f}-2 a f-\left (-2 c \sqrt {d} \sqrt {f}+b f\right ) x}{\sqrt {a+b x+c x^2}}\right )}{\sqrt {d} f}-\frac {\left (\left (B \sqrt {d}+A \sqrt {f}\right ) \left (c d+b \sqrt {d} \sqrt {f}+a f\right )\right ) \text {Subst}\left (\int \frac {1}{4 c d f+4 b \sqrt {d} f^{3/2}+4 a f^2-x^2} \, dx,x,\frac {-b \sqrt {d} \sqrt {f}-2 a f-\left (2 c \sqrt {d} \sqrt {f}+b f\right ) x}{\sqrt {a+b x+c x^2}}\right )}{\sqrt {d} f} \\ & = -\frac {B \sqrt {a+b x+c x^2}}{f}-\frac {(b B+2 A c) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {c} f}-\frac {\left (B \sqrt {d}-A \sqrt {f}\right ) \sqrt {c d-b \sqrt {d} \sqrt {f}+a f} \tanh ^{-1}\left (\frac {b \sqrt {d}-2 a \sqrt {f}+\left (2 c \sqrt {d}-b \sqrt {f}\right ) x}{2 \sqrt {c d-b \sqrt {d} \sqrt {f}+a f} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {d} f^{3/2}}+\frac {\left (B \sqrt {d}+A \sqrt {f}\right ) \sqrt {c d+b \sqrt {d} \sqrt {f}+a f} \tanh ^{-1}\left (\frac {b \sqrt {d}+2 a \sqrt {f}+\left (2 c \sqrt {d}+b \sqrt {f}\right ) x}{2 \sqrt {c d+b \sqrt {d} \sqrt {f}+a f} \sqrt {a+b x+c x^2}}\right )}{2 \sqrt {d} f^{3/2}} \\ \end{align*}
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.95 (sec) , antiderivative size = 619, normalized size of antiderivative = 1.87 \[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=-\frac {2 B \sqrt {a+x (b+c x)}-\frac {2 (b B+2 A c) \text {arctanh}\left (\frac {\sqrt {c} x}{\sqrt {a}-\sqrt {a+x (b+c x)}}\right )}{\sqrt {c}}+\text {RootSum}\left [c^2 d-b^2 f+4 \sqrt {a} b f \text {$\#$1}-2 c d \text {$\#$1}^2-4 a f \text {$\#$1}^2+d \text {$\#$1}^4\&,\frac {-A c^2 d \log (x)+A b^2 f \log (x)+a b B f \log (x)-a A c f \log (x)+A c^2 d \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right )-A b^2 f \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right )-a b B f \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right )+a A c f \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right )-2 \sqrt {a} B c d \log (x) \text {$\#$1}-2 \sqrt {a} A b f \log (x) \text {$\#$1}-2 a^{3/2} B f \log (x) \text {$\#$1}+2 \sqrt {a} B c d \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right ) \text {$\#$1}+2 \sqrt {a} A b f \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right ) \text {$\#$1}+2 a^{3/2} B f \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right ) \text {$\#$1}+b B d \log (x) \text {$\#$1}^2+A c d \log (x) \text {$\#$1}^2+a A f \log (x) \text {$\#$1}^2-b B d \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right ) \text {$\#$1}^2-A c d \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right ) \text {$\#$1}^2-a A f \log \left (-\sqrt {a}+\sqrt {a+b x+c x^2}-x \text {$\#$1}\right ) \text {$\#$1}^2}{-\sqrt {a} b f+c d \text {$\#$1}+2 a f \text {$\#$1}-d \text {$\#$1}^3}\&\right ]}{2 f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(540\) vs. \(2(251)=502\).
Time = 0.82 (sec) , antiderivative size = 541, normalized size of antiderivative = 1.63
method | result | size |
risch | \(-\frac {B \sqrt {c \,x^{2}+b x +a}}{f}-\frac {\frac {B b \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )}{\sqrt {c}}+2 A \sqrt {c}\, \ln \left (\frac {\frac {b}{2}+c x}{\sqrt {c}}+\sqrt {c \,x^{2}+b x +a}\right )-\frac {\left (A \sqrt {d f}\, b f -A a \,f^{2}-A c d f +B \sqrt {d f}\, a f +B \sqrt {d f}\, c d -B b d f \right ) \ln \left (\frac {\frac {-2 b \sqrt {d f}+2 f a +2 c d}{f}+\frac {\left (-2 c \sqrt {d f}+b f \right ) \left (x +\frac {\sqrt {d f}}{f}\right )}{f}+2 \sqrt {\frac {-b \sqrt {d f}+f a +c d}{f}}\, \sqrt {\left (x +\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (-2 c \sqrt {d f}+b f \right ) \left (x +\frac {\sqrt {d f}}{f}\right )}{f}+\frac {-b \sqrt {d f}+f a +c d}{f}}}{x +\frac {\sqrt {d f}}{f}}\right )}{\sqrt {d f}\, f \sqrt {\frac {-b \sqrt {d f}+f a +c d}{f}}}-\frac {\left (A \sqrt {d f}\, b f +A a \,f^{2}+A c d f +B \sqrt {d f}\, a f +B \sqrt {d f}\, c d +B b d f \right ) \ln \left (\frac {\frac {2 b \sqrt {d f}+2 f a +2 c d}{f}+\frac {\left (2 c \sqrt {d f}+b f \right ) \left (x -\frac {\sqrt {d f}}{f}\right )}{f}+2 \sqrt {\frac {b \sqrt {d f}+f a +c d}{f}}\, \sqrt {\left (x -\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (2 c \sqrt {d f}+b f \right ) \left (x -\frac {\sqrt {d f}}{f}\right )}{f}+\frac {b \sqrt {d f}+f a +c d}{f}}}{x -\frac {\sqrt {d f}}{f}}\right )}{\sqrt {d f}\, f \sqrt {\frac {b \sqrt {d f}+f a +c d}{f}}}}{2 f}\) | \(541\) |
default | \(\frac {\left (-A f -B \sqrt {d f}\right ) \left (\sqrt {\left (x -\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (2 c \sqrt {d f}+b f \right ) \left (x -\frac {\sqrt {d f}}{f}\right )}{f}+\frac {b \sqrt {d f}+f a +c d}{f}}+\frac {\left (2 c \sqrt {d f}+b f \right ) \ln \left (\frac {\frac {2 c \sqrt {d f}+b f}{2 f}+c \left (x -\frac {\sqrt {d f}}{f}\right )}{\sqrt {c}}+\sqrt {\left (x -\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (2 c \sqrt {d f}+b f \right ) \left (x -\frac {\sqrt {d f}}{f}\right )}{f}+\frac {b \sqrt {d f}+f a +c d}{f}}\right )}{2 f \sqrt {c}}-\frac {\left (b \sqrt {d f}+f a +c d \right ) \ln \left (\frac {\frac {2 b \sqrt {d f}+2 f a +2 c d}{f}+\frac {\left (2 c \sqrt {d f}+b f \right ) \left (x -\frac {\sqrt {d f}}{f}\right )}{f}+2 \sqrt {\frac {b \sqrt {d f}+f a +c d}{f}}\, \sqrt {\left (x -\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (2 c \sqrt {d f}+b f \right ) \left (x -\frac {\sqrt {d f}}{f}\right )}{f}+\frac {b \sqrt {d f}+f a +c d}{f}}}{x -\frac {\sqrt {d f}}{f}}\right )}{f \sqrt {\frac {b \sqrt {d f}+f a +c d}{f}}}\right )}{2 \sqrt {d f}\, f}+\frac {\left (A f -B \sqrt {d f}\right ) \left (\sqrt {\left (x +\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (-2 c \sqrt {d f}+b f \right ) \left (x +\frac {\sqrt {d f}}{f}\right )}{f}+\frac {-b \sqrt {d f}+f a +c d}{f}}+\frac {\left (-2 c \sqrt {d f}+b f \right ) \ln \left (\frac {\frac {-2 c \sqrt {d f}+b f}{2 f}+c \left (x +\frac {\sqrt {d f}}{f}\right )}{\sqrt {c}}+\sqrt {\left (x +\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (-2 c \sqrt {d f}+b f \right ) \left (x +\frac {\sqrt {d f}}{f}\right )}{f}+\frac {-b \sqrt {d f}+f a +c d}{f}}\right )}{2 f \sqrt {c}}-\frac {\left (-b \sqrt {d f}+f a +c d \right ) \ln \left (\frac {\frac {-2 b \sqrt {d f}+2 f a +2 c d}{f}+\frac {\left (-2 c \sqrt {d f}+b f \right ) \left (x +\frac {\sqrt {d f}}{f}\right )}{f}+2 \sqrt {\frac {-b \sqrt {d f}+f a +c d}{f}}\, \sqrt {\left (x +\frac {\sqrt {d f}}{f}\right )^{2} c +\frac {\left (-2 c \sqrt {d f}+b f \right ) \left (x +\frac {\sqrt {d f}}{f}\right )}{f}+\frac {-b \sqrt {d f}+f a +c d}{f}}}{x +\frac {\sqrt {d f}}{f}}\right )}{f \sqrt {\frac {-b \sqrt {d f}+f a +c d}{f}}}\right )}{2 \sqrt {d f}\, f}\) | \(803\) |
[In]
[Out]
Timed out. \[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=- \int \frac {A \sqrt {a + b x + c x^{2}}}{- d + f x^{2}}\, dx - \int \frac {B x \sqrt {a + b x + c x^{2}}}{- d + f x^{2}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Exception generated. \[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {(A+B x) \sqrt {a+b x+c x^2}}{d-f x^2} \, dx=\int \frac {\left (A+B\,x\right )\,\sqrt {c\,x^2+b\,x+a}}{d-f\,x^2} \,d x \]
[In]
[Out]